package org.extremengine.demo;

import java.awt.Graphics;

import org.extremengine.common.RigidBody;
import org.extremengine.common.Velocity;
import org.extremengine.shape.Circle;
import org.extremengine.shape.ParallelRectangle;

@Deprecated
public class PanelCrash extends BasePanelWorld {

	RigidBody ball;
	RigidBody box;

	public PanelCrash(DemoCallback demoCallback) {
		super(demoCallback);
	}

	@Override
	public void initDemoWorld() {
		super.initDemoWorld();
		ball = world.createRigidBody(new Object(), 0, 0.5, 20, new Circle(40, 25, 2));
		ball.setV(new Velocity(20, 225));
		
		box = world.createRigidBody(new Object(), 0, 0.5, 40, new ParallelRectangle(30, 40, 5, 10));
		box.setV(new Velocity(20, 90));
		
	}

	@Override
	public void paint(Graphics g) {
		super.paint(g);
		if(!world.isRunning()) {
			this.drawRigidBody(g, ball);
			this.drawRigidBody(g, box);
		}
	}

}
